import request from '@/utils/request'

    //获取SPU商品Array
    export const commodityList = (form) => 
    request({
        url:'/op/commodity_spu/get_commodity_spu_list',
        method: 'get',
        params:{
        	pageNo:form.pageNo,
        	pageSize:form.pageSize,
        	keyWord:form.keyword
        } 
    }) 
    
    // 删除 SPU商品
    export const delCommodity = (code) => 
    request({
        url:'/sys/commodity_spu/delete_commodity_spu',
        method: 'get',
        params:{
            code
        } 
    }) 
    
    export const submitCommodity = (url,form) => 
    request({
        url,
        method: 'post',
        data:JSON.stringify(form)
    }) 

    //获取类别Array
    export const CategoryList = (form) => 
    request({
        url:'/op/category/get_category_list',
        method: 'get',
        params:{
        	pageNo:1,
        	pageSize:10,
        	
        } 
    }) 

    // 新增 商品专题 
    export const editCommodity_theme = (url,form) => 
    request({
        url,
        method: 'post',
        data:JSON.stringify(form)
    }) 
    // 获取商品专题列表
    export const getCommodity_theme = (form) => 
    request({
        url:'/sys/commodity_theme/get_commodity_theme_list',
        method: 'get',
        params:{
        	pageNo:1,
        	pageSize:form.pageSize, 
        } 
    }) 
    //获取指定的商品专题
    export const getCommodity = (code) => 
    request({
        url:'/sys/commodity_theme/get_commodity_theme',
        method: 'get',
        params:{
            code
        } 
    })
    
